package de.shortys.myhome.api.view.components;

import java.awt.Graphics;

import javax.swing.ImageIcon;
import javax.swing.JPanel;

public class JImagePanel extends JPanel {

	private static final long serialVersionUID = 1L;

	private ImageIcon image;

	public JImagePanel(ImageIcon image) {
		super();
		this.image = image;
		this.setOpaque(false);
	}

	@Override
	protected void paintComponent(Graphics g) {
		super.paintComponent(g);
		g.drawImage(image.getImage(), 0, 0, getSize().width, getSize().height, null);
	}

}
